#include "IdManager.h"
using namespace SGLib;

SINGLETON_CLASS_INIT(CIdManager);

void CIdManager::Init(u64 id)
{
    m_nextId = id;
}

u64 CIdManager::GetNextId()
{
    u64 ret = 0;
    {
        ret = m_nextId;
        ++m_nextId;
        if( m_nextId == 0 )
        {
            m_nextId = 1;
        }
    }
    return ret;
}

